Report with parameters’ query

Let us examine construction of a more complicated report, in which parameters would be requested in the dialogue window before the report begins to be constructed. To do this, perform the following actions.

Add a dialogue form into the report. Put the "Query," "Label," "Edit," and "Button" components on the report form:

Set components’ properties:
Query1:
DatabaseName = 'DBDEMOS'
SQL = 'Select * from Customer.db where CustNo > :p1'

Label1:
Caption = 'Select if CustNo greather than'

Edit1:
Text = '2000'

Button1:
Caption = 'OK'
ModalResult = mrOk

Button2:
Caption = 'Cancel'
ModalResult = mrCancel

Open the "Params" property’s editor of the "Query" component, and then set the parameter:

After that, go to page with the report form and create a report in the way similar to that demonstrated in the previous example:

Upon constructing a report, the dialogue, in which a user will be offered to enter a customer number, will be displayed. After entering a requested value and clicking on the "ÎÊ" button, the report constructing is finished. The customers with numbers larger than the entered one will be outtyped.